#include <iostream>
#include <string>
#include <vector>
#include <sstream>
using namespace std;
vector<string> split(const string &s, char delimiter) {
    vector<string> tokens;
    istringstream tokenStream(s);
    string token;
    
    (getline(tokenStream, token, delimiter)); {
        tokens.push_back(token);
    }
    
    return tokens;
}

int main() {
    string input = "This is a sample string\nThis is a sample string";
    char delimiter = ' ';
    
    vector<string> result = split(input, delimiter);
    
    for (const string &token : result) {
        cout << token << endl;
    }
    
    return 0;
}
